# Import renderer from previous code sample
from CustomRenderFactory import CustomRenderFactory

from plasTeX.TeX import TeX

# Instantiate a TeX processor and parse the input text
tex = TeX()
tex.ownerDocument.config['files']['split-level'] = -100
tex.ownerDocument.config['files']['filename'] = 'test.xml'
tex.input( open("anthology4_lite.tex").read()  )
document = tex.parse()

# Render the document
renderer = CustomRenderFactory.buildCustomRender()
renderer.render(document)